package com.lifeverse.entity.enums;

/**
 * 用户状态枚举
 */
public enum UserStatus {
    
    /**
     * 活跃
     */
    ACTIVE("活跃"),
    
    /**
     * 非活跃
     */
    INACTIVE("非活跃"),
    
    /**
     * 锁定
     */
    LOCKED("锁定"),
    
    /**
     * 禁用
     */
    DISABLED("禁用"),
    
    /**
     * 待激活
     */
    PENDING_ACTIVATION("待激活"),
    
    /**
     * 已删除
     */
    DELETED("已删除");
    
    private final String description;
    
    UserStatus(String description) {
        this.description = description;
    }
    
    public String getDescription() {
        return description;
    }
    
    /**
     * 判断是否为可用状态
     */
    public boolean isAvailable() {
        return this == ACTIVE;
    }
    
    /**
     * 判断是否为锁定状态
     */
    public boolean isLocked() {
        return this == LOCKED;
    }
    
    /**
     * 判断是否为禁用状态
     */
    public boolean isDisabled() {
        return this == DISABLED || this == DELETED;
    }
    
    /**
     * 判断是否需要激活
     */
    public boolean needsActivation() {
        return this == PENDING_ACTIVATION;
    }
}